@extends('layout.master')

@section('content')
    <div class="row">
        <div class="col-md-3">
            <div class="panel panel-info">
                <div class="panel-heading">
                    <h3 class="panel-title">相关文档</h3>
                </div>
                <div class="panel-body">
                    <div class="list-group">
                        @foreach($relatedArticles as $relatedArticle)
                            <a href="{{ route('content', ['id' => $relatedArticle->id]) }}" class="list-group-item">
                                {{ $relatedArticle->title }}
                            </a>
                        @endforeach
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-9">
            <ol class="breadcrumb">
                <li><a href="{{ route('list', ['id' => $category->id]) }}">{{ $category->name }}</a></li>
                <li class="active">{{ $article->title }}</li>
            </ol>
            <div class="panel panel-info">
                <div class="panel-body">
                    {!! $article->content !!}
                    @if(!empty($article->download_file))
                        <div class="text-center">
                            <a class="btn btn-primary"
                               href="{{ route('download', ['id' => $article->id]) }}" target="_blank">
                                点击下载
                            </a>
                        </div>
                    @endif
                </div>
            </div>
        </div>
    </div>
@endsection